﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head><link rel="stylesheet" href="${ctx}/common/common.css">
    <title>Title</title>
    <link rel="stylesheet" href="${ctx}/common/plugins/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${ctx}/common/plugins/layuiadmin/style/admin.css" media="all">
    <script src="${ctx}/common/plugins/layuiadmin/layui/layui.js"></script>
    
    <script src="${ctx}/common/plugins/publicJs/publicJs.js"></script>
    <style type="text/css">
    	.rowtop{
    		padding: 10px
    	}
    	.valtop{
    		padding: 9px
    	}
    	.msg-pic{
			position: absolute;
		    margin-left: -350px;
		    left: 50%;
		    z-index: 301;
		    display: none;
		    z-index: 999;
		}
		.msg-pic img{
			width: 700px;
		}
    </style>
</head>
<body>
<form class="layui-form" action="${ctx}/enterprise/saveEnterprise" method="post" enctype="multipart/form-data">
    <input type="hidden" name="id" value="${tenterprise.id}" />
    <input type="hidden" name="deleteFlag" value="0" />
    <div class="layui-row rowtop" style="margin-top: 20px;">
	    <div class="layui-col-md5">
	        <label class="layui-form-label">企业名称</label>
	        <div class="layui-input-block valtop">
	            ${tenterprise.name}
	        </div>
	    </div>
	    <div class="layui-col-md5">
    		<label class="layui-form-label">行政区域</label>
		  	<div class="layui-input-block valtop">
				${areaname }
			</div>
    	</div>

    </div>
    <div class="layui-row rowtop">
     <div class="layui-col-md5">
	        <label class="layui-form-label">营业执照代码</label>
	        <div class="layui-input-block valtop">
	            ${tenterprise.code}
	        </div>
	    </div>
	    <div class="layui-col-md5">
	        <label class="layui-form-label">法人</label>
	        <div class="layui-input-block valtop">
	            ${tenterprise.legalPerson}
	        </div>
	    </div>    	
    </div>
    <div class="layui-row rowtop">
    	<div class="layui-col-md5">
	    	<label class="layui-form-label">营业执照</label>
			    <div class="layui-upload-list" id="looklicence2">
			    	<div id="bigimg1">
			    		<c:if test="${licence2.licence_timg != nul && licence2.licence_timg != '' }">
			    			<img style="width: 100px;height: 100px;display:none;" src="${ctx }${licence2.licence_img }" class="layui-upload-img">
			    			<img style="width: 100px;height: 100px;" src="${ctx }${licence2.licence_timg }" class="layui-upload-img">
			    		</c:if>
			    	</div>
			    </div>
		</div>
    	<div class="layui-col-md5">
	    	<label class="layui-form-label">法人身份证</label>
			 <div class="layui-upload-list" id="lookcard">
			    	<div id="bigimg2">
				    	<c:if test="${tenterprise.idcardTimg != nul && tenterprise.idcardTimg != '' }">
				    		<img  style="width: 100px;height: 100px;display:none;" src="${ctx }${tenterprise.idcardImg}" class="layui-upload-img">
				    		<img style="width: 100px;height: 100px;" src="${ctx }${tenterprise.idcardTimg}" class="layui-upload-img">
				    	</c:if>
			    	</div>
			    </div>
		</div>
    </div>
    <div class="layui-row rowtop">
	    <div class="layui-col-md5">
	      <label class="layui-form-label">营业执照有效期</label>
			<div class="layui-input-block valtop">
	            <fmt:formatDate value='${licence2.invalid_date}' pattern="yyyy-MM-dd"/>
	        </div>
	    </div>
	    <div class="layui-col-md5">
	        <label class="layui-form-label">安全管理员</label>
	        <div class="layui-input-block valtop">
	            ${tenterprise.securityOfficer}
	        </div>
	    </div>
    </div>
    <div class="layui-row rowtop">
	    <div class="layui-col-md5">
	         <label class="layui-form-label">联系人</label>
	        <div class="layui-input-block valtop">
	            ${tenterprise.contact}
	        </div>
	    </div>
	    <div class="layui-col-md5">
	       <label class="layui-form-label">联系人电话</label>
	        <div class="layui-input-block valtop">
	            ${tenterprise.phone}
	        </div>
	    </div>
    </div>
    <div class="layui-row rowtop">
	    <div class="layui-col-md5">
	        <label class="layui-form-label">生产许可证</label>
		    <div class="layui-upload-list" id="looklicence">
		    	<div id="bigimg3">
		    		<c:if test="${licence1.licence_timg != nul && licence1.licence_timg != '' }">
		    			<img style="width: 100px;height: 100px;display:none;" src="${ctx }${licence1.licence_img }" class="layui-upload-img">
		    			<img style="width: 100px;height: 100px;" src="${ctx }${licence1.licence_timg }" class="layui-upload-img">
		    		</c:if>
		    	</div>
		    </div>
	    </div>
	    <div class="layui-col-md5">
	        <label class="layui-form-label">企业logo</label>
		   	    <div class="layui-upload-list" id="looklogo">
	    	<div id="bigimg4">
	    		<c:if test="${tenterprise.logoTimg != nul && tenterprise.logoTimg != '' }">
	    			<img style="width: 100px;height: 100px;display:none;" src="${ctx }${tenterprise.logoImg}" class="layui-upload-img">
	    			<img style="width: 100px;height: 100px;" src="${ctx }${tenterprise.logoTimg}" class="layui-upload-img">
	    		</c:if>
	    	</div>
	    </div>
	    </div>
    </div>
    <div class="layui-row rowtop">
	    <div class="layui-col-md5">
	       <label class="layui-form-label">生产许可证有效期</label>
			<div class="layui-input-block valtop">
	            <fmt:formatDate value='${licence1.invalid_date}' pattern="yyyy-MM-dd"/>
	        </div>
	    </div>
	   	    <div class="layui-col-md5">
	        <label class="layui-form-label">企业简称</label>
	        <div class="layui-input-block valtop">
	            ${tenterprise.abbreviation}
	        </div>
	    </div> 
    </div>
    <div class="layui-row rowtop">
	    <div class="layui-col-md5">
	        <label class="layui-form-label">企业网址</label>
	       <div class="layui-input-block valtop">
				${tenterprise.website}
			</div> 
	    </div>
	    <div class="layui-col-md5">
	       <label class="layui-form-label">生产地址</label>
	        <div class="layui-input-block valtop">
	            ${tenterprise.productAddress}
	        </div>
	    </div>
    </div>
    <div class="layui-row rowtop">
	    <div class="layui-col-md5">
	        <label class="layui-form-label">注册地址</label>
	        <div class="layui-input-block valtop">
	            ${tenterprise.regAddress}
	        </div>
	    </div>
	    <div class="layui-col-md5">
	         <label class="layui-form-label">传真</label>
	        <div class="layui-input-block valtop">
	            ${tenterprise.fax}
	        </div>
	    </div>
    </div>
    <div class="layui-row rowtop">
	    <div class="layui-col-md5">
	        <label class="layui-form-label">电子邮箱</label>
	        <div class="layui-input-block valtop">
	            ${tenterprise.email}
	        </div> 
	    </div>
	    <div class="layui-col-md5">
	        <label class="layui-form-label">邮编</label>
	        <div class="layui-input-block valtop">
	            ${tenterprise.postcode}
	        </div>
	    </div>
    </div>
    <div class="layui-row rowtop">
    	<div class="layui-col-md5">
	    	<label class="layui-form-label">企业简介</label>
			<div class="layui-input-block valtop">
				${tenterprise.introduction }
			</div>
		</div>
    </div>
  
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="button" id="rollback" class="layui-btn layui-btn-primary">返回</button>
        </div>
    </div>
	<div class="msg-pic" id="msg-pic"> </div>
</form>
<script>

    document.getElementById("rollback").addEventListener("click",function(){
        window.history.back();
    })
   
    //Demo
    layui.use('form', function(){
    	var $=layui.$;
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
           layer.load(1, {
                shade: [0.1,'#fff'] //0.1透明度的白色背景
            });
            $("#formBtn").attr("disabled",true);
        });
        
        document.getElementById("bigimg1").addEventListener("click",function(){
			var imgSrc = document.getElementById("bigimg1").getElementsByTagName("img")[0].src
			var img = "<img src='"+imgSrc+"' alt='' />";
			$("#msg-pic").css({'display':'block'})
			$("#msg-pic").css({"top":($(window).scrollTop())+"px"})
			$("#msg-pic").html(img);
	
    })
        document.getElementById("bigimg2").addEventListener("click",function(){
			var imgSrc = document.getElementById("bigimg2").getElementsByTagName("img")[0].src
			var img = "<img src='"+imgSrc+"' alt='' />";
			$("#msg-pic").css({'display':'block'})
			$("#msg-pic").css({"top":($(window).scrollTop())+"px"})
			$("#msg-pic").html(img);
	
    })
        document.getElementById("bigimg3").addEventListener("click",function(){
			var imgSrc = document.getElementById("bigimg3").getElementsByTagName("img")[0].src
			var img = "<img src='"+imgSrc+"' alt='' />";
			$("#msg-pic").css({'display':'block'})
			$("#msg-pic").css({"top":($(window).scrollTop())+"px"})
			$("#msg-pic").html(img);
	
    })
        document.getElementById("bigimg4").addEventListener("click",function(){
			var imgSrc = document.getElementById("bigimg4").getElementsByTagName("img")[0].src
			var img = "<img src='"+imgSrc+"' alt='' />";
			$("#msg-pic").css({'display':'block'})
			$("#msg-pic").css({"top":($(window).scrollTop())+"px"})
			$("#msg-pic").html(img);
	
    })
        document.getElementById("msg-pic").addEventListener("click",function(){
	 			$('#msg-pic').css({'display':'none'})
	
    })
    });

    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#approval_time' //指定元素
            ,type: 'datetime'
        });
    });
</script>
</body>
</html>



